#include <vector>
#include <map>
#include <string>
#include <iostream>

using namespace std;

struct Comilicated
{

    int year;
    double country;
    string name;
    Comilicated(int a , double b , string c)
        :year(a), country(b), name(c)
    {
        cout << "is constructed " << endl;
    }

    Comilicated(const Comilicated &other):
        year(other.year),
        country(other.country), 
        name(std::move(other.name))
    {
        cout << "is moved" << endl;
    }
};

int main()
{
    std::map<int, Comilicated> m;

    int anInt = 4;
    double aDouble = 5.0;
    string aString = "C++";
    cout << "--insert--" << endl;
    m.insert(make_pair(4, Comilicated(anInt, aDouble, aString))); //这是一个map

    cout << "--emplace--" << endl;
    m.emplace(5, Comilicated(anInt, aDouble, aString));//这是一个map
    
    cout << "--emplace_back--" << endl;
    vector<Comilicated> v;
    v.emplace_back(anInt, aDouble, aString);

    cout << "--push_back--" << endl;
    v.push_back(Comilicated(anInt, aDouble, aString));

    return 0; 
}
